package cmd

import (
	"gitee.com/theegg/go-brick/cmd/cmd_cache"
	"gitee.com/theegg/go-brick/cmd/cmd_db"
	"gitee.com/theegg/go-brick/cmd/cmd_server"
	"github.com/spf13/cobra"
	"os"
)

// 定义命令
var rootCmd = &cobra.Command{
	Use:   "go-brick",
	Short: "go-brick是一个内部cms项目",
	Long:  `go-brick是一个内部基础项目, 可在此基础上做增量开发,　CMS, 电商, 旅游`,
	Args: func(cmd *cobra.Command, args []string) error {
		return nil
	},
	Run: func(cmd *cobra.Command, args []string) {

	},
}

// 注册命令
func init() {
	rootCmd.AddCommand(cmd_server.StartCmd)
	rootCmd.AddCommand(cmd_cache.StartCmd)
	rootCmd.AddCommand(cmd_db.StartCmd)
}

// 执行
func Execute() {
	if err := rootCmd.Execute(); err != nil {
		os.Exit(1)
	}
}
